package com.zs.usc.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.zs.usc.enums.YesOrNo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author ZS
 * @since 2021-11-13
 */
@TableName("usc_user")
@ApiModel(value = "UserInfo对象", description = "用户表")
@Data
@ToString
public class UserInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "标识", hidden = true)
    @TableId(value = "user_Id", type = IdType.ASSIGN_ID)
    private String userId;

    @ApiModelProperty(value = "用户名")
    @TableField("username")
    @NotBlank(message = "{参数名称不能为空！}")
    private String username;

    @ApiModelProperty(value = "组织:用作数据权限")
    @TableField("group_Id")
    private String groupId;

    @ApiModelProperty(value = "密码")
    @TableField("password")
    private String password;

    @ApiModelProperty(value = "是否是已经删除")
    @TableField("is_Delete")
    private YesOrNo isDelete;

    @ApiModelProperty(value = "是否锁定(登入多次失败后锁定)")
    @TableField("is_Locked")
    private YesOrNo isLocked;

    @ApiModelProperty(value = "是否禁用用户")
    @TableField("is_Forbidden")
    private YesOrNo isForbidden;

    @ApiModelProperty(value = "用户生效时间")
    @TableField("effective_Time")
    private LocalDateTime effectiveTime;

    @ApiModelProperty(value = "用户失效时间")
    @TableField("invalidation_Time")
    private LocalDateTime invalidationTime;

    @ApiModelProperty(value = "最后一次登录错误时间")
    @TableField("last_Error_Time")
    private LocalDateTime lastErrorTime;

    @ApiModelProperty(value = "登录错误次数")
    @TableField("errcount")
    private Integer errcount;

    @ApiModelProperty(value = "用户锁定时间")
    @TableField("locked_Time")
    private LocalDateTime lockedTime;

    @ApiModelProperty(value = "手机号码")
    @TableField("phone")
    private String phone;

    @ApiModelProperty(value = "电子邮件")
    @TableField("email")
    private String email;

    @ApiModelProperty(value = "描述")
    @TableField("description")
    private String description;
    @ApiModelProperty(value = "创建者")
    @TableField(value = "creator_Id",fill = FieldFill.INSERT)
    private String creatorId;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_Time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "最后修改者")
    @TableField(value = "last_Update_User_Id",fill = FieldFill.INSERT_UPDATE)
    private String lastUpdateUserId;

    @ApiModelProperty(value = "最后修改时间")
    @TableField(value = "last_Update_Time",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime lastUpdateTime;
}

